package com.gsx.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;

@RestController
@Slf4j
public class TestController {

    @GetMapping("/testLog")
    public String showLog(String name){
        log.info("系统调用了showLog接口"+name);
        return "TestController";
    }

    @GetMapping("/bugLog")
    public String showBugLog(){
        ArrayList<String> list = new ArrayList<String>();
        String s = null;
        try {
            s = list.get(0);
        } catch (Exception e) {
            log.error("系统调用了bugLog接口发生了错误:"+e.getClass().getName()+e.getMessage());

        }
        return s;
    }

}
